package Tests;

import static org.junit.Assert.*;

import gui.ServerUI;

import java.sql.SQLException;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;

import junit.framework.Assert;

import messagesPacks.ActivityReportMessage;

import org.junit.AfterClass;
import org.junit.Before;
import org.junit.Test;

import controllers.DBController;


import Entity.ActivityRecored;

public class TestNumberOfSuspendedSubscribers 
{
	DBController dbc;
	ActivityReportMessage activityMsg;
	String str_date;
	
	@Before
	public void setUp() throws Exception 
	{
		dbc = new DBController("localhost", 3306,"root", "root", "obl");
		activityMsg = new ActivityReportMessage();
		
		//DateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
		//str_date = format.format(ServerUIP.clk.getTime());		
	}

	
	@Test
	public void testActiveSubscribers()
	{
		 int expected =1;
		 dbc.makeActivityReportForCurrentDate(activityMsg ,"");
		 int result =Integer.parseInt( activityMsg.Activity_Array.get(0).numofSuspendedSubscribers);
		 Assert.assertEquals(expected, result);
		
	}

}